package com.zx.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * 
 * @TableName sys_role
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName(value ="sys_role")
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Long roleId;

    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 角色描述
     */
    private String roleDesc;

    /**
     * 状态
     */
    private Integer roleFlag;

    /**
     * 用户对应的角色（一对多关联）
     */
    @TableField(exist = false) // 屏蔽数据库字段与属性对应
    private Set<Right> rights = new HashSet<>(0);

    public Role(String roleName) {
        this.roleName = roleName;
    }
}